package com.quanquan.management.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/userLabel")
public class UserLabelController extends ManagerBaseController {

    @GetMapping("/list")
    public String list() {
        return "user/user_label_list";
    }

    @GetMapping("/syn_record")
    public String syn_record(@RequestParam String id, Model model) {
        model.addAttribute("id", id);
        return "user/syn_record_list";
    }

    @GetMapping("/form")
    public String form(@RequestParam String type, Model model) {
        if ("edit".equals(type)) {
            model.addAttribute("title", "编辑规则");
        } else if ("add".equals(type)) {
            model.addAttribute("title", "新增规则");
        } else {
            model.addAttribute("error", "操作类型不存在");
        }
        model.addAttribute("type", type);
        model.addAttribute("adminId");
        return "user/user_label_form";
    }

    @GetMapping("/operate")
    public String operate(Model model){
        model.addAttribute("title", "操作");
        model.addAttribute("adminId");
        return "user/user_label_operate";
    }

    @GetMapping("/synRecordDetail")
    public String synRecordDetail(@RequestParam String groupId,@RequestParam String id,Model model){
        model.addAttribute("title", "数据展示");
        model.addAttribute("groupId",groupId);
        model.addAttribute("recordId",id);
        return "user/syn_record_detail";
    }


}
